// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 返回模型文件名称，删除模型 DELETE /Model/delete */
export async function deleteModelUsingDELETE(
  body: API.modelFile,
  options?: { [key: string]: any },
) {
  return request<string>('/Model/delete', {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 接受模型文件的名称,下载模型 POST /Model/download */
export async function DownloadUsingPOST(body: API.trainFile, options?: { [key: string]: any }) {
  return request<any>('/Model/download', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取模型特征重要性数据，返回排名前10的数据 POST /Model/FeatureImport */
export async function FeatureDataUsingPOST(body: API.Document, options?: { [key: string]: any }) {
  return request<API.EntryStringInt_[]>('/Model/FeatureImport', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** GetFeatureData POST /Model/GetFeatureImport */
export async function GetFeatureDataUsingPOST(
  body: API.PredictDocument,
  options?: { [key: string]: any },
) {
  return request<string>('/Model/GetFeatureImport', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 返回所有模型文件的名称 GET /Model/list */
export async function listUsingGET(options?: { [key: string]: any }) {
  return request<API.modelFile[]>('/Model/list', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 接受测试数据文件名称和模型文件的名称，预测数据 POST /Model/Predit */
export async function PreditModelUsingPOST(
  body: API.PredictDocument,
  options?: { [key: string]: any },
) {
  return request<string>('/Model/Predit', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 预测多个数据 POST /Model/PreditMulti */
export async function PreditMultiModelUsingPOST(
  body: Record<string, any>,
  options?: { [key: string]: any },
) {
  return request<string>('/Model/PreditMulti', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** ResultFeatureData POST /Model/ResultFeatureData */
export async function ResultFeatureDataUsingPOST(
  body: API.modelFile,
  options?: { [key: string]: any },
) {
  return request<API.Result>('/Model/ResultFeatureData', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 接受训练数据文件名称,训练模型 POST /Model/Train */
export async function TrainModelUsingPOST(body: API.trainFile, options?: { [key: string]: any }) {
  return request<string>('/Model/Train', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
